import request from '@/config/axios'

// 拨交单明细 VO
export interface DeliveryReceiptDetailVO {
  id: number // 主键ID
  deliveryReceiptId: number // 交接单ID
  orderId: string // 订单ID
  internalCode: string // 内码
  productionCode: string // 成品码
  type: string // 规格型号
  lastCollectionTime: Date // 最后一次集采时间
  outDeptId: number // 转出部门ID
  outDeptName: string // 转出部门名称
  recvDeptId: number // 接收部门ID
  recvDeptName: string // 接收部门名称
  submitTime: Date // 提交时间
  remark: string // 备注
}

export interface DeliveryReceiptSummaryVO {
  id: number // 主键ID
  deliveryReceiptId: number // 交接单ID
  orderId: string // 订单ID
  flex: string //订单规格
  len: string //长度
  jis: string //JR/INT/SR
  type: string // 类型
  outDeptName: string // 转出部门名称
  recvDeptName: string // 接收部门名称
}

// 拨交单明细 API
export const DeliveryReceiptDetailApi = {
  // 查询拨交单明细分页
  getDeliveryReceiptDetailPage: async (params: any) => {
    return await request.get({ url: `/project/delivery-receipt-detail/page`, params })
  },

  // 查询拨交单明细详情
  getDeliveryReceiptDetail: async (id: number) => {
    return await request.get({ url: `/project/delivery-receipt-detail/get?id=` + id })
  },

  // 新增拨交单明细
  createDeliveryReceiptDetail: async (data: DeliveryReceiptDetailVO) => {
    return await request.post({ url: `/project/delivery-receipt-detail/create`, data })
  },

  // 修改拨交单明细
  updateDeliveryReceiptDetail: async (data: DeliveryReceiptDetailVO) => {
    return await request.put({ url: `/project/delivery-receipt-detail/update`, data })
  },

  // 删除拨交单明细
  deleteDeliveryReceiptDetail: async (id: number) => {
    return await request.delete({ url: `/project/delivery-receipt-detail/delete?id=` + id })
  },

  // 导出拨交单明细 Excel
  exportDeliveryReceiptDetail: async (params) => {
    return await request.download({ url: `/project/delivery-receipt-detail/export-excel`, params })
  },

  getDeliveryReceiptDetailReport: async (params: any) => {
    return await request.get({ url: `/project/delivery-receipt-detail/getReport`, params })
  },

  exportDeliverReport: async (params) => {
    return await request.download({ url: `/project/delivery-receipt-detail/exportDeliverReport`, params })
  },
  getDeliveryReceiptSummaryReport: async (params: any) => {
    return await request.get({ url: `/project/delivery-receipt-detail/getDeliveryReceiptSummaryReport`, params })
  },
  exportDeliverSummaryReport: async (params) => {
    return await request.download({ url: `/project/delivery-receipt-detail/exportDeliverSummaryReport`, params })
  },



}
